Skip to content

Respect UpdateColumns filters#18

Open
akshithg wants to merge 1 commit into
letsencrypt:mainfrom
trailofbits:updatecolumns-filter-cache
Open

Respect UpdateColumns filters#18
akshithg wants to merge 1 commit into
letsencrypt:mainfrom
trailofbits:updatecolumns-filter-cache

Conversation

@akshithg
Copy link
Copy Markdown

@akshithg akshithg commented Jun 5, 2026

Summary

Fixes #15.

This change keeps the cached update bind plan for unfiltered updates, but builds
filtered update plans per call. ColumnFilter functions are supplied by callers
and do not have a stable cache key, so reusing one table-level cached plan across
different filters can make UpdateColumns write columns rejected by the current
filter.

The new regression coverage checks both full-to-filtered and filtered-to-filtered
update sequences, including the exact generated SQL and bound values.

Verification

  • go test ./... -run '^(TestUpdateColumnsDoesNotReusePriorFullUpdatePlan|TestUpdateColumnsDoesNotReusePriorFilteredUpdatePlan|TestMySQLDialect|TestPostgresDialect)$' -count=1 -v
  • go test ./... -count=1
  • go build ./...
  • git diff --cached --check

@akshithg akshithg requested a review from a team as a code owner June 5, 2026 22:33
@akshithg akshithg requested a review from beautifulentropy June 5, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UpdateColumns can reuse cached update plans across column filters

1 participant